﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PBOffice.Models;
using PBOffice.BLL;

public partial class MeetingRoomManager_MeetingRoomInfo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.ddlNewsType.DataSource = new MeetingRoomManager().GetAllMeetingRoom();
            ddlNewsType.DataBind();
            MeetingRoom room = new MeetingRoomManager().GetAllMeetingRoom(new MeetingRoomManager().GetAllMeetingRoom()[0].RoomNo);
            this.lbArea.Text = room.RoomArea.ToString();
            this.lbCounts.Text = room.Counts.ToString();
            this.lbEqi.Text = room.Equipment;
            this.lbName.Text = room.RoomName;
            this.lbNo.Text = room.RoomNo;
            this.lbType.Text = room.RoomType.TypeName;
            this.imgRoom.ImageUrl = room.RoomImge;
        }
    }
    protected void btnCheck_Click(object sender, EventArgs e)
    {
        string no = ddlNewsType.SelectedItem.Value;
        MeetingRoom room = new MeetingRoomManager().GetAllMeetingRoom(no);
        this.lbArea.Text = room.RoomArea.ToString();
        this.lbCounts.Text = room.Counts.ToString();
        this.lbEqi.Text = room.Equipment;
        this.lbName.Text = room.RoomName;
        this.lbNo.Text = room.RoomNo;
        this.lbType.Text = room.RoomType.TypeName;
        this.imgRoom.ImageUrl = room.RoomImge;
    }
}